<div class="user">
<?php echo $this->Form->create('User');?>
	<fieldset>
 		<legend><?php __('User Login'); ?></legend>
	<?php
		if (Configure::read('User.useUsername')) {
			echo $this->Form->input('username');
			$input = 'UserUsername';
		} else {
			echo $this->Form->input('email');
			$input = 'UserEmail';
		}
		echo $this->Form->input('password');
		if (Configure::read('User.useRememberMe')) {
			echo $this->Form->input('auto_login', array('type' => 'checkbox', 'label' => __('Remember me', true)));
		}
	?>
	</fieldset>
<?php echo $this->Form->end(__('Sign In', true));?>
<?php echo $this->Html->link(__('Forgot password', true), array('controller' => 'users', 'action' => 'recover'));?>
</div>

<script>
$(function() {

    $('#<?=$input?>').focus();

});
</script>